package com.forezp.thinking.chapter18;

import java.io.*;

/**
 * Created by forezp on 2017/12/11.
 */
public class BinaryFile {

    public byte[] ReadFile(String fileName) throws IOException {
        File file = new File(fileName);
        if (!file.exists()) {
            throw new FileNotFoundException("file nor found");
        }
        BufferedInputStream in = new BufferedInputStream(new FileInputStream(file));
        byte[] bytes=new byte[in.available()];
        in.read(bytes);
        in.close();
        return bytes;

    }

    public static void main(String[] args) {

    }
}
